const net = require('net');
const socket = new net.Socket();

socket.setEncoding('utf8');
socket.connect(3000,'localhost', () => {
    socket.write('n:baibai');
});

socket.on('data', data => {
    console.log(data);
});

setTimeout(() => {
    socket.end();
},3000)